package com.yibo.yunpicture.application.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yibo.yunpicture.interfaces.dto.space.SpaceAddDTO;
import com.yibo.yunpicture.interfaces.dto.space.SpaceQueryDTO;
import com.yibo.yunpicture.domain.space.entity.Space;
import com.yibo.yunpicture.domain.user.entity.User;
import com.yibo.yunpicture.interfaces.vo.space.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author AdminMYB
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-05-13 13:31:57
*/
public interface SpaceApplicationService extends IService<Space> {


    /**
     * 创建空间
     * @param spaceAddDTO
     * @param loginUser
     * @return
     */
    long addSpace(SpaceAddDTO spaceAddDTO, User loginUser);

    /**
     * 根据空间等级填充空间信息
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);

    /**
     *查询图片列表
     * @param spaceQueryDTO
     * @return
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryDTO spaceQueryDTO);

    /**
     * 根据空间分页获取空间VO
     * @param spacePage
     * @param request
     * @return
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);

    /**
     * 根据空间获取空间VO
     * @param space
     * @param request
     * @return
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);

    /**
     * 空间权限校验
     *
     * @param loginUser
     * @param space
     */
    void checkSpaceAuth(User loginUser, Space space);
}
